import Home from '../pages/Home.vue'
// import About from '../pages/About.vue'
// import Other from '../pages/Other.vue'
import {
    createWebHashHistory, // 前端路由形式之一
    createRouter
} from 'vue-router'

const routes = [
    // 扩展性很好
    {
        path: '/',
        name: 'Home',
        component: Home
    },
    {
        path: '/about',
        name: 'About',
        // component: About
        component:()=>import('../pages/About.vue')
    },
    {
        path: '/other',
        name: 'Other',
        // component: Other
        component:()=>import('../pages/Other.vue')
    }
]

const router = createRouter({
    // 配置前端路由的形式 hash 还是 history
    history: createWebHashHistory(),
    routes
})

export default router